package com.happok.onlineclass.usermanagement.user.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.Map;

/**
 * 接口分类                        
 * 功能说明
 *
 * @author : chenac
 * @module 项目名称/模块名          yapi 项目组/子项目
 * @date : 2021/6/29 13:51
 */
@Data
@ApiModel(value = "添加用户参数")
public class AddUserDTO {
    /**
     * 昵称，20个字符
     */
    @ApiModelProperty(value = "昵称", required = true)
    @NotBlank(message = "昵称不能为空")
    @Length(max = 20, message = "昵称长度过长")
    private String nickName;

    /**
     * 电话号码，11个字符
     */
    @ApiModelProperty(value = "电话号码")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "账号格式不正确")
    @Length(max = 11, message = "电话号码长度过长")
    private String phone;
    /**
     * 邮箱，100个字符
     */
    @ApiModelProperty(value = "邮箱")
    @Pattern(regexp = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$", message = "账号格式不正确")
    @Length(max = 100, message = "邮箱长度过长")
    private String email;
    /**
     * 用户头像id
     */
    @ApiModelProperty(value = "用户头像id")
    private String headPortraitId;
    /**
     * 用户头像路径，200个字符
     */
    @ApiModelProperty(value = "用户头像路径")
    private String headPortraitUrl;
    /**
     * 用户密码，6-50个字符
     */
    @ApiModelProperty(value = "密码")
    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 50, message = "密码长度不匹配")
    private String password;
    /**
     * 用户扩展信息
     */
    @ApiModelProperty(value = "用户扩展信息")
    private Map<String, Object> extendData;
}